package com.qf.utils;

import org.apache.http.HttpHost;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestClientBuilder;
import org.elasticsearch.client.RestHighLevelClient;

public class ESUtil {
    /**
     * 返回连接ES得的对象
     * @return
     */
    public static RestHighLevelClient getClient(){
        HttpHost httpHost = new HttpHost("10.9.41.192",9200);

        RestClientBuilder restClientBuilder = RestClient.builder(httpHost);

        RestHighLevelClient client = new RestHighLevelClient(restClientBuilder);

        return client;
    }
}
